﻿using Event.Rule;
using PluginAPI.Core;
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;
using PluginAPI.Events;



namespace BindLimit.Main
{
    public class CodeLoad
    {
        public static CodeLoad Singleton { get; set; }

        [PluginConfig] public Config Config;


        [PluginEntryPoint("02 捆绑后处理", "v1.0.0", "捆绑处理", "River")]
        [PluginPriority(LoadPriority.Medium)]
        public void Load()
        {
            if (!this.Config.IsEnabled) return;

            Singleton = this;

            EventManager.RegisterEvents<BindLimtEvent>(this.Config.IsEnabled);

            Log.Info($"NWPluginAPI| 捆绑处理 | 加载");
        }


        [PluginUnload]
        public void UnLoad()
        {
            Singleton = null;

            EventManager.UnregisterEvents(this);
        }
    }
}
